%line 1+1 ./interrupt/intrentry.S
[bits 32]
%line 1+1 lib/global.inc

LOADER_BASE_ADDR equ 0x500
LOADER_CODE_ADDR equ 0x900
LOADER_STACK_TOP equ 0x9f000
LOADER_GDT_LIMIT equ 0x700 - LOADER_BASE_ADDR


DESC_BASE_31TO24_OFFSET equ 24
DESC_G_4K equ 1<<23
DESC_D_32 equ 1<<22
DESC_B_32 equ 1<<22
DESC_L_64 equ 1<<21
DESC_AVL_1 equ 1<<20
DESC_LIMIT_19TO16_OFFSET equ 16
DESC_P_1 equ 1<<15
DESC_DPL_0 equ 0<<13
DESC_DPL_1 equ 1<<13
DESC_DPL_2 equ 2<<13
DESC_DPL_3 equ 3<<13
DESC_S_USR equ 1<<12
DESC_TYPE_X_EXE equ 1<<11
DESC_TYPE_C_COR equ 1<<10
DESC_TYPE_E_DOWN equ 1<<10
DESC_TYPE_R equ 1<<9
DESC_TYPE_W equ 1<<9
DESC_TYPE_A equ 1<<8
DESC_BASE_23TO16_OFFSET equ 0


SELECTOR_GDTINDEX_OFFSET equ 3
SELECTOR_TI_LDT equ 1<<1
SELECTOR_RPL_0 equ 0
SELECTOR_RPL_1 equ 1
SELECTOR_RPL_2 equ 2
SELECTOR_RPL_3 equ 3


PAGE_DIR_BASE equ 0x1000
PAGE_SIZE equ 0x1000
PAGE_US_U equ 1<<2
PAGE_RW_W equ 1<<1
PAGE_P equ 1<<0



KERNEL_TEMP_ADDR equ 0x70000
KERNEL_ENTRY_OFFSET equ 0x18
KERNEL_STACK_TOP equ 0xc009f000



e_phentsize_offset equ 42
e_phoff_offset equ 28
e_phnum_offset equ 44

p_type_offset equ 0
p_filesz_offset equ 16
p_offset_offset equ 4
p_vaddr_offset equ 8

PT_NULL equ 0







%line 71+1 lib/global.inc
SELECTOR_CODE equ 1 << SELECTOR_GDTINDEX_OFFSET | !SELECTOR_TI_LDT | SELECTOR_RPL_0
%line 74+1 lib/global.inc
SELECTOR_DATA equ 2 << SELECTOR_GDTINDEX_OFFSET | !SELECTOR_TI_LDT | SELECTOR_RPL_0
%line 77+1 lib/global.inc
SELECTOR_VIDEO equ 3 << SELECTOR_GDTINDEX_OFFSET | !SELECTOR_TI_LDT | SELECTOR_RPL_0




IDT_DESC_P_1 equ 1<<15
IDT_DESC_DPL_0 equ 0<<13
IDT_DESC_S_USR equ 1<<12
IDT_DESC_TYPE_D_32 equ 1<<11

IDT_SIMPLE_CNT equ 0x80
IDT_SYSCALL_HANDLER equ 0x80



FDT_SEC_SIZE equ 14

FDT_SEC_ID equ 2*100+1

FDT_ITEM_SIZE equ 32

FDI_START_OFFSET equ 0x1A

FAT_SEC_OFFSET equ 2*100-1

FAT_BPS equ 0x200

FAT1_BASE equ 0x200

FAT2_BASE equ 0x1400

FAT_RsvdSecCnt equ 0x8



FDT_TEMP_ADDR equ 0x8000

FAT_TEMP_ADDR equ 0x8000
%line 1+1 lib/portio.inc





%line 11+1 lib/portio.inc


%line 17+1 lib/portio.inc




%line 28+1 lib/portio.inc




%line 4+1 ./interrupt/intrentry.S


%line 8+1 ./interrupt/intrentry.S
[section .data]
[extern IntrSolveTable]

[section .text]











































InitPic:
 push eax
 push edx



 mov al, 0x11
%line 61+0 ./interrupt/intrentry.S
 mov dx, 0x20
 out dx, al
%line 62+1 ./interrupt/intrentry.S


 mov al, 0x20
%line 64+0 ./interrupt/intrentry.S
 mov dx, 0x21
 out dx, al
%line 65+1 ./interrupt/intrentry.S


 mov al, 0x04
%line 67+0 ./interrupt/intrentry.S
 mov dx, 0x21
 out dx, al
%line 68+1 ./interrupt/intrentry.S


 mov al, 0x01
%line 70+0 ./interrupt/intrentry.S
 mov dx, 0x21
 out dx, al
%line 71+1 ./interrupt/intrentry.S




 mov al, 0x11
%line 75+0 ./interrupt/intrentry.S
 mov dx, 0xA0
 out dx, al
%line 76+1 ./interrupt/intrentry.S


 mov al, 0x28
%line 78+0 ./interrupt/intrentry.S
 mov dx, 0xA1
 out dx, al
%line 79+1 ./interrupt/intrentry.S


 mov al, 0x02
%line 81+0 ./interrupt/intrentry.S
 mov dx, 0xA1
 out dx, al
%line 82+1 ./interrupt/intrentry.S




 mov al, 0xf8
%line 86+0 ./interrupt/intrentry.S
 mov dx, 0x21
 out dx, al
%line 87+1 ./interrupt/intrentry.S

 mov al, 0xbf
%line 88+0 ./interrupt/intrentry.S
 mov dx, 0xA1
 out dx, al
%line 89+1 ./interrupt/intrentry.S

 pop edx
 pop eax
 ret




%line 124+1 ./interrupt/intrentry.S

[section .text]
intrExit:
 add esp, 4
 popad
 pop gs
 pop fs
 pop es
 pop ds
 add esp, 4
 iretd





[section .data]
[global IntrEntryTable]
IntrEntryTable:




[section .text]
%line 147+0 ./interrupt/intrentry.S
IntrEntry0x00:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x00
 call [IntrSolveTable + 0x00 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x00

%line 148+1 ./interrupt/intrentry.S


[section .text]
%line 150+0 ./interrupt/intrentry.S
IntrEntry0x01:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x01
 call [IntrSolveTable + 0x01 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x01

%line 151+1 ./interrupt/intrentry.S


[section .text]
%line 153+0 ./interrupt/intrentry.S
IntrEntry0x02:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x02
 call [IntrSolveTable + 0x02 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x02

%line 154+1 ./interrupt/intrentry.S


[section .text]
%line 156+0 ./interrupt/intrentry.S
IntrEntry0x03:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x03
 call [IntrSolveTable + 0x03 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x03

%line 157+1 ./interrupt/intrentry.S


[section .text]
%line 159+0 ./interrupt/intrentry.S
IntrEntry0x04:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x04
 call [IntrSolveTable + 0x04 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x04

%line 160+1 ./interrupt/intrentry.S


[section .text]
%line 162+0 ./interrupt/intrentry.S
IntrEntry0x05:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x05
 call [IntrSolveTable + 0x05 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x05

%line 163+1 ./interrupt/intrentry.S


[section .text]
%line 165+0 ./interrupt/intrentry.S
IntrEntry0x06:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x06
 call [IntrSolveTable + 0x06 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x06

%line 166+1 ./interrupt/intrentry.S


[section .text]
%line 168+0 ./interrupt/intrentry.S
IntrEntry0x07:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x07
 call [IntrSolveTable + 0x07 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x07

%line 169+1 ./interrupt/intrentry.S


[section .text]
%line 171+0 ./interrupt/intrentry.S
IntrEntry0x08:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x08
 call [IntrSolveTable + 0x08 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x08

%line 172+1 ./interrupt/intrentry.S


[section .text]
%line 174+0 ./interrupt/intrentry.S
IntrEntry0x09:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x09
 call [IntrSolveTable + 0x09 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x09

%line 175+1 ./interrupt/intrentry.S

[section .text]
%line 176+0 ./interrupt/intrentry.S
IntrEntry0x0a:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x0a
 call [IntrSolveTable + 0x0a * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x0a

%line 177+1 ./interrupt/intrentry.S

[section .text]
%line 178+0 ./interrupt/intrentry.S
IntrEntry0x0b:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x0b
 call [IntrSolveTable + 0x0b * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x0b

%line 179+1 ./interrupt/intrentry.S

[section .text]
%line 180+0 ./interrupt/intrentry.S
IntrEntry0x0c:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x0c
 call [IntrSolveTable + 0x0c * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x0c

%line 181+1 ./interrupt/intrentry.S


[section .text]
%line 183+0 ./interrupt/intrentry.S
IntrEntry0x0d:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x0d
 call [IntrSolveTable + 0x0d * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x0d

%line 184+1 ./interrupt/intrentry.S

[section .text]
%line 185+0 ./interrupt/intrentry.S
IntrEntry0x0e:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x0e
 call [IntrSolveTable + 0x0e * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x0e

%line 186+1 ./interrupt/intrentry.S

[section .text]
%line 187+0 ./interrupt/intrentry.S
IntrEntry0x0f:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x0f
 call [IntrSolveTable + 0x0f * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x0f

%line 188+1 ./interrupt/intrentry.S

[section .text]
%line 189+0 ./interrupt/intrentry.S
IntrEntry0x10:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x10
 call [IntrSolveTable + 0x10 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x10

%line 190+1 ./interrupt/intrentry.S

[section .text]
%line 191+0 ./interrupt/intrentry.S
IntrEntry0x11:
 nop

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x11
 call [IntrSolveTable + 0x11 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x11

%line 192+1 ./interrupt/intrentry.S

[section .text]
%line 193+0 ./interrupt/intrentry.S
IntrEntry0x12:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x12
 call [IntrSolveTable + 0x12 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x12

%line 194+1 ./interrupt/intrentry.S

[section .text]
%line 195+0 ./interrupt/intrentry.S
IntrEntry0x13:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x13
 call [IntrSolveTable + 0x13 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x13

%line 196+1 ./interrupt/intrentry.S

[section .text]
%line 197+0 ./interrupt/intrentry.S
IntrEntry0x14:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x14
 call [IntrSolveTable + 0x14 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x14

%line 198+1 ./interrupt/intrentry.S
[section .text]
%line 198+0 ./interrupt/intrentry.S
IntrEntry0x15:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x15
 call [IntrSolveTable + 0x15 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x15

%line 199+1 ./interrupt/intrentry.S
[section .text]
%line 199+0 ./interrupt/intrentry.S
IntrEntry0x16:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x16
 call [IntrSolveTable + 0x16 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x16

%line 200+1 ./interrupt/intrentry.S
[section .text]
%line 200+0 ./interrupt/intrentry.S
IntrEntry0x17:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x17
 call [IntrSolveTable + 0x17 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x17

%line 201+1 ./interrupt/intrentry.S
[section .text]
%line 201+0 ./interrupt/intrentry.S
IntrEntry0x18:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x18
 call [IntrSolveTable + 0x18 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x18

%line 202+1 ./interrupt/intrentry.S
[section .text]
%line 202+0 ./interrupt/intrentry.S
IntrEntry0x19:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x19
 call [IntrSolveTable + 0x19 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x19

%line 203+1 ./interrupt/intrentry.S
[section .text]
%line 203+0 ./interrupt/intrentry.S
IntrEntry0x1a:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x1a
 call [IntrSolveTable + 0x1a * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x1a

%line 204+1 ./interrupt/intrentry.S
[section .text]
%line 204+0 ./interrupt/intrentry.S
IntrEntry0x1b:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x1b
 call [IntrSolveTable + 0x1b * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x1b

%line 205+1 ./interrupt/intrentry.S
[section .text]
%line 205+0 ./interrupt/intrentry.S
IntrEntry0x1c:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x1c
 call [IntrSolveTable + 0x1c * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x1c

%line 206+1 ./interrupt/intrentry.S
[section .text]
%line 206+0 ./interrupt/intrentry.S
IntrEntry0x1d:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x1d
 call [IntrSolveTable + 0x1d * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x1d

%line 207+1 ./interrupt/intrentry.S
[section .text]
%line 207+0 ./interrupt/intrentry.S
IntrEntry0x1e:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x1e
 call [IntrSolveTable + 0x1e * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x1e

%line 208+1 ./interrupt/intrentry.S
[section .text]
%line 208+0 ./interrupt/intrentry.S
IntrEntry0x1f:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x1f
 call [IntrSolveTable + 0x1f * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x1f

%line 209+1 ./interrupt/intrentry.S


[section .text]
%line 211+0 ./interrupt/intrentry.S
IntrEntry0x20:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x20
 call [IntrSolveTable + 0x20 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x20

%line 212+1 ./interrupt/intrentry.S
[section .text]
%line 212+0 ./interrupt/intrentry.S
IntrEntry0x21:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x21
 call [IntrSolveTable + 0x21 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x21

%line 213+1 ./interrupt/intrentry.S
[section .text]
%line 213+0 ./interrupt/intrentry.S
IntrEntry0x22:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x22
 call [IntrSolveTable + 0x22 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x22

%line 214+1 ./interrupt/intrentry.S
[section .text]
%line 214+0 ./interrupt/intrentry.S
IntrEntry0x23:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x23
 call [IntrSolveTable + 0x23 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x23

%line 215+1 ./interrupt/intrentry.S
[section .text]
%line 215+0 ./interrupt/intrentry.S
IntrEntry0x24:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x24
 call [IntrSolveTable + 0x24 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x24

%line 216+1 ./interrupt/intrentry.S
[section .text]
%line 216+0 ./interrupt/intrentry.S
IntrEntry0x25:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x25
 call [IntrSolveTable + 0x25 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x25

%line 217+1 ./interrupt/intrentry.S
[section .text]
%line 217+0 ./interrupt/intrentry.S
IntrEntry0x26:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x26
 call [IntrSolveTable + 0x26 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x26

%line 218+1 ./interrupt/intrentry.S
[section .text]
%line 218+0 ./interrupt/intrentry.S
IntrEntry0x27:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x27
 call [IntrSolveTable + 0x27 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x27

%line 219+1 ./interrupt/intrentry.S
[section .text]
%line 219+0 ./interrupt/intrentry.S
IntrEntry0x28:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x28
 call [IntrSolveTable + 0x28 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x28

%line 220+1 ./interrupt/intrentry.S
[section .text]
%line 220+0 ./interrupt/intrentry.S
IntrEntry0x29:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x29
 call [IntrSolveTable + 0x29 * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x29

%line 221+1 ./interrupt/intrentry.S
[section .text]
%line 221+0 ./interrupt/intrentry.S
IntrEntry0x2a:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x2a
 call [IntrSolveTable + 0x2a * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x2a

%line 222+1 ./interrupt/intrentry.S
[section .text]
%line 222+0 ./interrupt/intrentry.S
IntrEntry0x2b:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x2b
 call [IntrSolveTable + 0x2b * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x2b

%line 223+1 ./interrupt/intrentry.S
[section .text]
%line 223+0 ./interrupt/intrentry.S
IntrEntry0x2c:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x2c
 call [IntrSolveTable + 0x2c * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x2c

%line 224+1 ./interrupt/intrentry.S
[section .text]
%line 224+0 ./interrupt/intrentry.S
IntrEntry0x2d:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x2d
 call [IntrSolveTable + 0x2d * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x2d

%line 225+1 ./interrupt/intrentry.S
[section .text]
%line 225+0 ./interrupt/intrentry.S
IntrEntry0x2e:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x2e
 call [IntrSolveTable + 0x2e * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x2e

%line 226+1 ./interrupt/intrentry.S
[section .text]
%line 226+0 ./interrupt/intrentry.S
IntrEntry0x2f:
 push 0

 push ds
 push es
 push fs
 push gs
 pushad




 mov al, 0x20
 out 0xa0, al
 out 0x20, al


 push 0x2f
 call [IntrSolveTable + 0x2f * 4]
 jmp intrExit

[section .data]
 dd IntrEntry0x2f

%line 227+1 ./interrupt/intrentry.S














[section .data]
[global IdtTable]
IdtTable:
 times IDT_SIMPLE_CNT + 1 dq 0h

lidt_param dq 0h

[section .text]
[global InitIdt]
InitIdt:
 call InitPic

 push ecx
 xor ecx, ecx
.LOOP:
 mov eax, [IntrEntryTable + ecx * 4]
 mov edx, eax
 and eax, 0x0000FFFF
 or eax, SELECTOR_CODE << 16
 mov [IdtTable + ecx * 8h], eax
 and edx, 0xFFFF0000
 or edx, DESC_P_1 | DESC_DPL_0 | DESC_S_USR | IDT_DESC_TYPE_D_32 | 110_00_00000b
 mov [IdtTable + ecx * 8h + 4], edx
 inc ecx
 cmp ecx, IDT_SIMPLE_CNT
 jne .LOOP

 mov eax, syscall_hander
 mov edx, eax
 and eax, 0x0000FFFF
 or eax, SELECTOR_CODE << 16
 mov [IdtTable + IDT_SYSCALL_HANDLER * 8h], eax
 and edx, 0xFFFF0000
 or edx, DESC_P_1 | DESC_DPL_3 | DESC_S_USR | IDT_DESC_TYPE_D_32 | 110_00_00000b
 mov [IdtTable + IDT_SYSCALL_HANDLER * 8h + 4], edx

 mov dword [lidt_param + 2], IdtTable
 mov word [lidt_param], IDT_SIMPLE_CNT * 8h + 8h
 lidt [lidt_param]
 pop ecx
 ret

[section .data]
[global syscall_table]
syscall_table:
 times 0xFF dd 0h

[section .text]
syscall_hander:

 push 0


 push ds
 push es
 push fs
 push gs
 pushad


 push 0x80


 push edx
 push ecx
 push ebx


 call [syscall_table + eax * 4]
 add esp, 12

 mov [esp + 8 * 4], eax
 jmp intrExit
